<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>天知道</title>
    <link rel="stylesheet" href="css/reset.css" />
    <link rel="stylesheet" href="css/tianindex.css" />
</head>

<body>
<div class="wrap" id="app" align="center">
    <div class="search_form">
        <div class="logo"><img src="./images/view.jpg" alt="logo" /></div>
        <div class="form_group">
            <input
                    type="text"
                    class="input_txt"
                    placeholder="请输入查询的天气"
                    v-model="city"
            />
            <button class="input_sub" @click="searchWeather">
                搜 索
            </button>
        </div>

    </div>
    <table width="300" border="1" align="center">
        <tr>
            <td>姓名</td>
            <td>年龄</td>
        </tr>
        <tr v-for="item in student">
            <td>{{item.sname}}</td>
            <td>{{item.age}}</td>
        </tr>
    </table>
</div>
<!-- 开发环境版本，包含了有帮助的命令行警告 -->
<script src="./js/vue.js"></script>
<!-- 官网提供的 axios 在线地址 -->
<script src="./js/axios.min.js"></script>
<!-- 自己的js -->
<script>
    let app=new Vue({
        el:"#app",
        data:{
            city:"",
            studentVo:{},
            student:[],
        },
        methods:{
            searchWeather(){
                axios.post("http://localhost:8080/student/get/1/5",this.studentVo).then(result=>{
                    this.student=result.data.data.records;
                    //console.log(result)
                })
            }
        }
    })
</script>



</body>
</html>